﻿<Window x:Class="WpfDemoApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="TinySteamWrapper Demo-Project" Height="524" Width="468" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <StackPanel Background="#FFF0F0F0">
        <StackPanel Orientation="Horizontal" Margin="10">
            <Label Content="Steam API Key" Width="100"/>
            <TextBox x:Name="TextAPIKey" Text="" VerticalAlignment="Center" Width="200"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Margin="10">
            <Label Content="Username"  Width="100"/>
            <TextBox x:Name="TextBoxUsername" Width="200" VerticalAlignment="Center" />
            <Button x:Name="ButtonSearch" Content="Search" Click="Button_Click" Margin="10, 0, 0, 0" Width="50" VerticalAlignment="Center" />
            <TextBlock x:Name="TextLoading" Width="50" Visibility="Hidden" Margin="10, 0, 0, 0" Text="Loading..." VerticalAlignment="Center" />
        </StackPanel>
        <Grid Margin="10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="340"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Grid.Column="0" Content="Avatar" VerticalAlignment="Center"/>
            <Image Grid.Row="0" Grid.Column="1" Source="{Binding AvatarMedium}" Height="100" Width="100" HorizontalAlignment="Left" />

            <Label Grid.Row="1" Grid.Column="0" Content="SteamID"/>
            <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding SteamID}" />

            <Label Grid.Row="2" Grid.Column="0" Content="Realname"/>
            <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding RealName}" />

            <Label Grid.Row="3" Grid.Column="0" Content="Games"/>
            <ListView ItemsSource="{Binding Games}" Grid.Row="3" Grid.Column="1" Height="200">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="220"/>
                                <ColumnDefinition Width="80"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Text="{Binding App.Name}" />
                            <TextBlock Grid.Column="1" Text="{Binding TotalPlayTime.TotalHours, StringFormat='({0} hours)'}" />
                        </Grid>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>


        </Grid>
    </StackPanel>
</Window>
